All Questions
Tagged with circular-dependencyc++
2 questions
1vote
2answers
1kviews
Help with getting rid of circular dependency
I have the following circular dependency that I'd like to eliminate. I think I must have a flaw in my design. And I'd much appreciate any feedback on how to fix this. My circular dependency comes ...
16votes
5answers
26kviews
If A has B and B holds reference of A, is it a flawed design need to be fixed? [duplicate]
Suppose, I have class Boss and Worker; Boss has a Worker and Worker holds a reference of Boss: Boss.h #include "Worker.h" class Boss{ public: Worker worker; }; Worker.h class Boss; class Worker{...